package org.summer.lawyer.controller.admin;

import cn.dev33.satoken.annotation.SaIgnore;
import cn.hutool.core.util.IdUtil;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.summer.common.core.domain.R;
import org.summer.lawyer.im.ImService;
import org.summer.lawyer.im.dto.AccIdCreateDTO;
import org.summer.lawyer.im.dto.AccIdInfoDto;

/**
 *
 */
@Tag(name = "后台相关接口", description = "后台IM测试")
@SaIgnore
@RestController
@RequestMapping("/lawyer/im")
@RequiredArgsConstructor
public class ImController {


    private static final Logger log = LoggerFactory.getLogger(ImController.class);
    private final ImService imService;

    @PostMapping("/userCreate")
    public R<AccIdInfoDto> userCreate(@RequestBody AccIdCreateDTO dto){
        //AccIdCreateDTO accIdCreateDTO = new AccIdCreateDTO();
        dto.setAccid(IdUtil.nanoId(12).toLowerCase());
       // dto.setName("管理员");
        AccIdInfoDto accIdInfoDto = imService.userCreate(dto);
        return R.ok(accIdInfoDto);
    }
}
